mod s_io;
mod s_rand_compare;
/*  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at https://mozilla.org/MPL/2.0/. */
fn seprintln(_need: &str){
    eprintln!("[SWE] (slh) {}",_need)
}
fn main() {
    let args: Vec<String> = std::env::args().collect();
    /*
    读取slh {!!!}第一个段空格分割段作为命令，其后作为参数。
    效果：slh [operation] ...[arguments]..
    */
    if args.len() < 2 {
        seprintln("info:此程序是写着玩的，见笑了");
        std::process::exit(0)
    }
    let operation = args[1].as_str();
    match operation {
        "greet" => s_io::greet_first(),
        "echo" => s_io::echo(&args[2].to_string()),
        "guess" => s_rand_compare::guess_num(),
        &_ => todo!(),
    }
}
